home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcr / pcr4_4.lha / DIST / debugnub / INCLUDE / xr / CirioNubInstall.h < prev    next >
C/C++ Source or Header  |  1992-03-03  |  3KB  |  126 lines

  1. /* begincopyright
  2.   Copyright (c) 1988 Xerox Corporation. All rights reserved.
  3.   Use and copying of this software and preparation of derivative works based
  4.   upon this software are permitted. Any distribution of this software or
  5.   derivative works must comply with all applicable United States export
  6.   control laws. This software is made available AS IS, and Xerox Corporation
  7.   makes no warranty about the software, its performance or its conformity to
  8.   any specification. Any person obtaining a copy of this software is requested
  9.   to send their name and post office or electronic mail address to:
  10.     PCR Coordinator
  11.     Xerox PARC
  12.     3333 Coyote Hill Rd.
  13.     Palo Alto, CA 94304
  14.   endcopyright */
  15.  
  16. /*
  17.  * CirioNubInstall.h
  18.  *
  19.  * Demers, November 2, 1989 10:11:22 am PST
  20.  *
  21.  * Primitives used to install CirioNub.
  22.  */
  23.  
  24. #ifndef _CIRIO_NUB_INSTALL_
  25. #define _CIRIO_NUB_INSTALL_
  26.  
  27. #include "xr/Threads.h"
  28. #include "xr/CirioNubProtocol.h"
  29.  
  30.  
  31. /*
  32.  * Types
  33.  */
  34.  
  35. typedef char * CirioNubHandle;
  36. /*
  37.     (opaque) handle for CirioNub server
  38. */
  39.  
  40. typedef CirioNubRetCode
  41. (*CirioNubProc)(/* int argc, unsigned *args */);
  42. /*
  43.     Proc invoked from other side.
  44.     It runs on a slave IOP, not in a thread, so it can't acquire
  45.         locks (which implies it can't allocate memory, do I/O, ...).
  46.     Calling and called (this) procedure must agree on number and type
  47.         of args.
  48.     Return results by calling the marshalling procedures (CirioNubMarshall.h)
  49.         and returning the appropriate CirioNubRetCode value.
  50. */
  51.  
  52. typedef void
  53. (*CirioNubInitProc)(/* void * clientData */);
  54. /*
  55.     Initialization proc for CirioNub.
  56.     Called on slave IOP before creating listener.
  57. */
  58.  
  59.  
  60. /*
  61.  * Public procs
  62.  */
  63.  
  64. extern int
  65. CirioNubRegisterCProc(/* CirioNubHandle h, int procID, CirioNubProc proc */);
  66. /*
  67.     Register a C procedure with given procID.
  68.     Handle h may already have been installed, or not.
  69.     Return 0 on success, (-1) on failure.
  70. */
  71.  
  72.  
  73. extern int
  74. CirioNubRegisterMProc(/* CirioNubHandle h, int procID, XR_MesaProc mp */);
  75. /*
  76.     Analogous to CirioNubRegisterCProc, but registers a Mesa proc.
  77. */
  78.  
  79.  
  80. extern CirioNubHandle
  81. CirioNubGetDefaultHandle(/* int maxProcs, int callBufBytes */);
  82. /*
  83.     There's a "default" shared CirioNubHandle.
  84.     This behaves like a registration interface -- language runtimes
  85.       acquire the default handle and export (register) their
  86.       language-specific CirioNubProcs through it.
  87.     See CirioNubCreateHandle below.
  88. */
  89.  
  90.  
  91.  
  92. /*
  93.  * Friend procs
  94.  */
  95.  
  96.  
  97. extern CirioNubHandle
  98. CirioNubCreateHandle(/* int maxProcs, int callBufBytes */);
  99. /*
  100.     Create a CirioNub handle and return it.
  101.     Parameters are max number of procs that can be registered with this handle
  102.         and max number of bytes of arguments that can be processed.
  103.     Reserve a slave IOP for the handle to execute in.
  104.     Return NIL on failure.
  105. */
  106.  
  107.  
  108. extern int
  109. CirioNubInstall(/*
  110.     CirioNubHandle h,
  111.     unsigned listenerPort,
  112.     CirioNubInitProc initProc,
  113.     void *clientData
  114. */);
  115. /*
  116.     Install debug nub with procedures registered with handle h
  117.         listening at given TCP port.
  118.     If port is 0, well-known default port is used.
  119.     The initProc(clientData) is called in the slave IOP before the listener
  120.         is created.
  121.     Attempting to install a handle a second time succeeds but is a no-op.
  122. */
  123.  
  124.  
  125. #endif /* _CIRIO_NUB_INSTALL_ */
  126.